package com.tanhua.common.vo;

import lombok.Builder;
import lombok.Data;

/*
 * 业务异常对象
 *       将一些常见的业务错误封装到ErrorResult对象中
 * */
@Data
@Builder
public class ErrorResult {

    private String errCode = "999999";
    private String errMessage;


    public static ErrorResult error() {
        return ErrorResult.builder().errCode("999999").errMessage("系统异常稍后再试").build();
    }

    public static ErrorResult fail() {
        return ErrorResult.builder().errCode("000001").errMessage("发送验证码失败").build();
    }

    public static ErrorResult loginError() {
        return ErrorResult.builder().errCode("000002").errMessage("验证码失效").build();
    }

    public static ErrorResult faceError() {
        return ErrorResult.builder().errCode("000003").errMessage("图片非人像，请重新上传!").build();
    }

    public static ErrorResult mobileError() {
        return ErrorResult.builder().errCode("000004").errMessage("手机号码已注册").build();
    }

    public static ErrorResult contentError() {
        return ErrorResult.builder().errCode("000005").errMessage("动态内容为空").build();
    }

    public static ErrorResult likeError() {
        return ErrorResult.builder().errCode("000006").errMessage("用户已点赞").build();
    }

    public static ErrorResult disLikeError() {
        return ErrorResult.builder().errCode("000007").errMessage("用户未点赞").build();
    }

    public static ErrorResult loveError() {
        return ErrorResult.builder().errCode("000008").errMessage("用户已喜欢").build();
    }

    public static ErrorResult disloveError() {
        return ErrorResult.builder().errCode("000009").errMessage("用户未喜欢").build();
    }

    public static ErrorResult redisKeyError() {
        return ErrorResult.builder().errCode("000010").errMessage("验证码未失效").build();
    }

    public static ErrorResult checkCodeError() {
        return ErrorResult.builder().errCode("000011").errMessage("验证码错误").build();
    }

    public static ErrorResult tokenFail() {
        return ErrorResult.builder().errCode("000012").errMessage("token解析错误").build();
    }

    public static ErrorResult registUserInfo() {
        return ErrorResult.builder().errCode("000013").errMessage("填充资料失败").build();
    }

    public static ErrorResult head() {
        return ErrorResult.builder().errCode("000014").errMessage("头像更新失败").build();
    }

    public static ErrorResult picError() {
        return ErrorResult.builder().errCode("000015").errMessage("图片格式错误").build();
    }

    public static ErrorResult picUploadFail() {
        return ErrorResult.builder().errCode("000016").errMessage("图片上传失败").build();
    }

    public static ErrorResult videoUploadFail() {
        return ErrorResult.builder().errCode("000017").errMessage("小视频上传失败").build();
    }

    public static ErrorResult checkIsPortraitException() {
        return ErrorResult.builder().errCode("000018").errMessage("人脸识别出现异常").build();
    }

    public static ErrorResult updateLastActiveTimeFail() {
        return ErrorResult.builder().errCode("000019").errMessage("最近活跃时间更新失败!").build();
    }

    public static ErrorResult freezeFail() {
        return ErrorResult.builder().errCode("000020").errMessage("冻结用户失败!!!").build();
    }

    public static ErrorResult unfreezeFail() {
        return ErrorResult.builder().errCode("000021").errMessage("解冻用户失败!!!").build();
    }

    public static ErrorResult loginFreeze(String reasonsForFreezing) {
        return ErrorResult.builder().errCode("000022").errMessage("由于" + reasonsForFreezing + ",您的账号已被冻结登录").build();
    }

    public static ErrorResult talkingBeFreeze(String reasonsForFreezing) {
        return ErrorResult.builder().errCode("000023").errMessage("由于" + reasonsForFreezing + ",您的账号已被冻结发言").build();
    }

    public static ErrorResult postNotAllowedBeFreeze(String reasonsForFreezing) {
        return ErrorResult.builder().errCode("000023").errMessage("由于" + reasonsForFreezing + ",您的账号已被冻结发布动态").build();
    }
    public static ErrorResult sound() {
        return ErrorResult.builder().errCode("0000").errMessage("语音上传失败").build();
    }

    public static ErrorResult saveQuestionFail() {
        return ErrorResult.builder().errCode("000024").errMessage("设置陌生人问题失败").build();
    }

    public static ErrorResult codeError() {
        return ErrorResult.builder().errMessage("验证码错误").build();
    }

    public static ErrorResult nameAndPwdError() {
        return ErrorResult.builder().errMessage("用户名或密码错误").build();
    }

    public static ErrorResult updatePhoneFail() {
        return ErrorResult.builder().errMessage("手机号变更失败").build();
    }
}
